import React, {Suspense} from 'react';
import ReactDOM from 'react-dom/client';
import 'normalize.css'
import '@/assets/css/index.less'
import { RouterProvider } from 'react-router-dom';
import router from '@/router'
import {Provider} from 'react-redux'
import store from '@/store'
import {ThemeProvider} from 'styled-components'
import theme from '@/assets/theme'


const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  // <React.StrictMode>
  // 包裹异步加载回来的组件 其他使用store的组件才能订阅到异步组件修改的数据
  <Provider store={store}>
   <Suspense fallback="loading">
    <ThemeProvider theme={theme}>
      <RouterProvider router={router}></RouterProvider>
    </ThemeProvider>
   </Suspense>
  </Provider>
    
  // </React.StrictMode>
);
